using System;
using Microsoft.Pex.Framework;

namespace Covana
{
    public class Host
    {
        private int count;
        private IField _field;

        public Host()
        {
            
        }

        public Host(int count, IField field)
        {
            this.count = count;
            _field = field;
        }

        public bool IsEquals(Host other)
        {
            if (count != other.count)
            {
                return false;
            }

            if (!IsFieldEquals(_field, other._field))
            {
                return false;
            }

            return true;
        }

        private bool IsFieldEquals(IField c1, IField c2)
        {
            if (c1.Count == c2.Count)
            {
                return true;
            }
            return false;
        }
    }

    public interface IField
    {
        int Count { get; }
    }

    public class Field : IField
    {
        private int count;

        public int Count
        {
            get { return count; }
            set{ count = value;}
        }
    }

    [PexClass(typeof(Host))]
    public partial class PrivateMethodTest
    {
        [PexMethod]
        public void TestIsEquals([PexAssumeUnderTest] Host h1, [PexAssumeUnderTest] Host h2)
        {
            h1.IsEquals(h2);
        }
    }
}